package c.b.a.c.a.c;

public final class b0<T> implements c0, z {

    /* renamed from: c  reason: collision with root package name */
    private static final Object f1958c = new Object();

    /* renamed from: a  reason: collision with root package name */
    private volatile c0<T> f1959a;

    /* renamed from: b  reason: collision with root package name */
    private volatile Object f1960b = f1958c;

    private b0(c0<T> c0Var) {
        this.f1959a = c0Var;
    }

    public static <P extends c0<T>, T> c0<T> b(P p) {
        n.b(p);
        return !(p instanceof b0) ? new b0(p) : p;
    }

    public static <P extends c0<T>, T> z<T> c(P p) {
        if (p instanceof z) {
            return (z) p;
        }
        n.b(p);
        return new b0(p);
    }

    public final T a() {
        T t = this.f1960b;
        if (t == f1958c) {
            synchronized (this) {
                t = this.f1960b;
                if (t == f1958c) {
                    t = this.f1959a.a();
                    T t2 = this.f1960b;
                    if (t2 != f1958c) {
                        if (t2 != t) {
                            String valueOf = String.valueOf(t2);
                            String valueOf2 = String.valueOf(t);
                            StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 118 + String.valueOf(valueOf2).length());
                            sb.append("Scoped provider was invoked recursively returning different results: ");
                            sb.append(valueOf);
                            sb.append(" & ");
                            sb.append(valueOf2);
                            sb.append(". This is likely due to a circular dependency.");
                            throw new IllegalStateException(sb.toString());
                        }
                    }
                    this.f1960b = t;
                    this.f1959a = null;
                }
            }
        }
        return t;
    }
}
